<template>
  <div class="content-card">
    <div style="padding-top:10px;">
        <Card :bordered="false" dis-hover>
            <div slot="title">
              <span class="title" style="font-size:16px;">我的足迹</span>
            </div>
            <div v-for="dataItem in modules" :key="dataItem">
               <p><Icon type="ios-calendar-outline"/>{{dataItem}}</p>
              <div v-for="item in result[dataItem]" :key="item">
                <div>
                  <div v-if="item.markType==0" class="marginT20" style="border-bottom:1px solid #ccc;padding-bottom:20px;">
                    <productMsg :proMsg='item' text='立即前往' button></productMsg>
                  </div>
                  
                </div>
                <div>
                  <div v-if="item.markType==1" class="marginT20" style="border-bottom:1px solid #ccc;padding-bottom:20px;">
                    <infoMsg :infoMsg='item.markType==1' :img='banner'></infoMsg>
                  </div>
                  
                </div>
              </div>
              </div>
             
            
            <div class="marginT20">
                <Row class="marginT20">
                    <i-col span='14' offset='10'>
                        <Page :total="total" :current='currentPage' @on-change='pageChange' show-elevator />
                    </i-col>
                </Row> 
            </div>
        </Card>
    </div>   
  </div>
</template>
<script>
import productMsg from '@/components/productMsg'
import infoMsg from '@/components/infoMsg'
import banner from '@/assets/images/banner.png'
export default {
  data(){
    return{
      radio:1,
      a:'扫今冬阿森纳单买是大',
      product:1,
      banner:banner,
      productList:[],
      newsList:[],
      currentPage:1,
      total:null,
      modules:[],
      result:''
    }
  },
  components:{
    productMsg,
    infoMsg
  },
  mounted(){
    this.getMyFootprint()
  },
  methods:{
    pageChange(num){
      this.currentPage=num;
      this.getMyFootprint()
    },
    checkChange(idx){
      this.product=idx
    },
    getMyFootprint(){
      this.productList=[]
       this.newsList=[]
      this.$axios('myFootprintgetFootmarks',[this.currentPage,10],{
        userPhone:this.$token.getUUID()
      }).then(res=>{
        console.log(res)
        this.result=res.data.resMap
        this.modules=Object.keys(res.data.resMap)
        console.log(this.modules)
        this.total=res.data.listSize
        // res.data.resMap[20200504].forEach(ele=>{
        //   ele.markType == 0 ? this.productList.push(ele) : this.newsList.push(ele)
        // })
      })
    }
  }
}
</script>

<style>

</style>